package com.puzzlebazar.client.main.control;

public interface NamedStateController extends GenericController, SubStateTokenFactory {
	
	/**
	 * Adds a new named state and links it with the attached state 
	 * 
	 * @param stateName The name of the newly created state
	 * @param state The state to attach 
	 */
	public void addNamedState(String stateName, NamedState state);
	
	
	/**
	 * Access the default state name of the controller. There should 
	 * usually be an associated static method.
	 * 
	 * @return The name of the default state
	 */
	public String getDefaultStateName();
	
	/**
	 * Access the name of the current state
	 * 
	 * @return The name of the current state
	 */
	public String getCurrentStateName();
	
	/**
	 * Enters the state given a specific state name
	 * 
	 * @param stateName The name of the state to switch to
	 * @throws Exception 
	 */
	public void gotoStateNamed( String stateName ) throws Exception;
	

	/**
	 * Called whenever the subcontroller is entered, can be used to reinitialize
	 * subcontroller's views. Overriding methods should call the parent's method.
	 */
	public void enter();
	


	/**
	 * Called whenever the subcontroller is exited, can be used to reinitialize
	 * subcontroller's views. Overriding methods should call the parent's method.
	 */
	public void exit();	
	
}
